<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>答题闯关王</title>
    <link rel="shortcut icon" href="__STATIC__/favicon.ico"/>
    <link href="__STATIC__/css/index/index.css" type="text/css" rel="stylesheet">
	<link href="__STATIC__/layui/css/layui.css" type="text/css" rel="stylesheet">
    <link href="__STATIC__/css/index/iconfont/iconfont.css" type="text/css" rel="stylesheet">
	<link href="__STATIC__/bootstrap-3.3.7/css/bootstrap.min.css" type="text/css" rel="stylesheet">
	<script src="__STATIC__/js/jquery-3.3.1.js" type="application/javascript"></script>
	<script src="__STATIC__/layui/layui.all.js" type="application/javascript"></script>
	<style>
		.desktop .order-box table tbody tr td{
			text-align: center;
		}
	</style>
</head>
<body>
	<div class="desktop item-wrapper">
		<div class="desktop-main">
			<div class="order-box">
				<table cellspacing="0" ng-show="docArr.length>0">
					<thead>
						<tr>
							<td>id</td>
							<td>姓名</td>
							<td>电话</td>
							<td>奖品名称</td>
							<td>奖品账号</td>、
							<td>奖品密码</td>
							<td>奖品兑换时间</td>
						</tr>
					</thead>
					<tbody id="order-table">
					{volist name="records" id="record"}
						<tr>
							<td>{$record['id']}</td>
							<td>{$record['name']}</td>
							<td>{$record['telephone']}</td>
							<td>{$record['p_name']}</td>
							<td>{$record['p_account']}</td>
							<td>{$record['p_pwd']}</td>
							<td>{$record['time']}</td>
						</tr>
					{/volist}
					</tbody>
				</table>
				<div style="text-align: center">
					<div id="test1"></div>
				</div>
			</div>
		</div>
	</div>
    <script src="/static/js/maowenke.js"></script>
    <script>
        layui.use('laypage', function(){
            var laypage = layui.laypage;

            //执行一个laypage实例
            laypage.render({
                elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
                ,count:parseInt('{$shu}') //数据总数，从服务端得到
				,limit:10,
				jump:function (obj,first) {
					if(!first){
					    $.post("{:url('page/getRecord')}",{page:obj.curr,limit:10},function (data) {
					        console.log(data);
					        $('tbody').empty();
					        var str = '';
							$.each(data,function (i,v) {
								str+='<tr>'+
                                '<td>'+v.id+'</td>'+
                                '<td>'+tostr(v.name)+'</td>'+
                                '<td>'+tostr(v.telephone)+'</td>'+
                                '<td>'+tostr(v.p_name)+'</td>'+
                                '<td>'+tostr(v.p_account)+'</td>'+
                                '<td>'+tostr(v.p_pwd)+'</td>'+
                                '<td>'+tostr(v.time)+'</td>'+
                                '</tr>';
                            })
							$("tbody").append(str);
                        });
					}
                }
            });
        });
	</script>
</body>

</html>